//
//  ImageView.swift
//  myhub
//
//  Created by x on 2024/5/31.
//

import UIKit

open class ImageView: UIImageView {

    public override init(frame: CGRect) {
        super.init(frame: frame)
        makeUI()
    }
    
    public override init(image: UIImage?) {
        super.init(image: image)
        makeUI()
    }
    
    public override init(image: UIImage?, highlightedImage: UIImage?) {
        super.init(image: image, highlightedImage: highlightedImage)
        makeUI()
    }
    
    public required init?(coder: NSCoder) {
        super.init(coder: coder)
        makeUI()
    }
    
    open func makeUI() {
        tintColor = UIColor.DesignKit.primary()
        layer.masksToBounds = true
        contentMode = .center

        hero.modifiers = [.arc]
        updateUI()
    }
    open func updateUI() {
        setNeedsDisplay()
    }
}

